]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Revert "Defer initializing UI until after the global session has loaded"
authorRay Strode <rstrode@redhat.com>
Wed, 6 Mar 2013 22:25:28 +0000 (17:25 -0500)
committerRay Strode <rstrode@redhat.com>
Wed, 6 Mar 2013 22:26:15 +0000 (17:26 -0500)
This reverts commit 0bef925b5146794220a552f3422b0c0616466425.

Just for now.  Jasper has plans to clean up start up eventually.

https://bugzilla.gnome.org/show_bug.cgi?id=694321

js/ui/main.js
js/ui/sessionMode.js

index 936d74ee4906b304c0329ea20cc4f8bd8dd3955a..015b4b62038a60a0d92770dc7c4c31bfd4db047a 100644 (file)
@@ -98,21 +98,19 @@ function start() {
 
     Gio.DesktopAppInfo.set_desktop_env('GNOME');
 
-    shellDBusService = new ShellDBus.GnomeShell();
-    shellMountOpDBusService = new ShellMountOperation.GnomeShellMountOpHandler();
-
     sessionMode = new SessionMode.SessionMode();
-    sessionMode.connect('sessions-loaded', _sessionsLoaded);
-    sessionMode.init();
-}
 
-function _sessionsLoaded() {
-    sessionMode.connect('updated', _sessionUpdated);
-    _initializeUI();
-    _sessionUpdated();
+    // start session after we know what mode we're running in
+    let signalId = sessionMode.connect('updated', function() {
+                                           sessionMode.disconnect(signalId);
+                                           startSession();
+                                       });
 }
 
-function _initializeUI() {
+function startSession() {
+    shellDBusService = new ShellDBus.GnomeShell();
+    shellMountOpDBusService = new ShellMountOperation.GnomeShellMountOpHandler();
+
     // Ensure ShellWindowTracker and ShellAppUsage are initialized; this will
     // also initialize ShellAppSystem first.  ShellAppSystem
     // needs to load all the .desktop files, and ShellWindowTracker
index 7d6b2e4f6468aa1e19cec3afe4f6ddf5e891263d..e926ba2e73dbfe8717b643a0c11d457faabb65d9 100644 (file)
@@ -158,7 +158,12 @@ function listModes() {
 const SessionMode = new Lang.Class({
     Name: 'SessionMode',
 
-    init: function() {
+    _init: function() {
+        global.connect('notify::session-mode', Lang.bind(this, this._sync));
+        this._modes = _modes;
+        this._modeStack = [DEFAULT_MODE];
+        this._sync();
+
         _getModes(Lang.bind(this, function(modes) {
             this._modes = modes;
             let primary = modes[global.session_mode] &&
@@ -166,8 +171,6 @@ const SessionMode = new Lang.Class({
             let mode = primary ? global.session_mode : 'user';
             this._modeStack = [mode];
             this._sync();
-
-            this.emit('sessions-loaded');
         }));
     },